/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Informacion.Usuarios.Vista;

import Informacion.Usuarios.Controlador.AgregarUsuariosControlador;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.ComboBoxModel;
import sape.MenuControlador;
/**
 *
 * @author melis_000
 */
public class AgregarUsuarios extends javax.swing.JInternalFrame {

    public AgregarUsuariosControlador controlador = null;
    public ComboBoxModel cmbPuestoModel=null;



    public AgregarUsuarios(MenuControlador menu_controlador) {
       
        this.controlador=new AgregarUsuariosControlador(this,menu_controlador);
        this.controlador.setListaPuestos();
        initComponents();
        pnlVehiculo.setVisible(false);
        this.controlador.disable();
//        this.cmbPuestoTrabajo.addItemListener(new ItemListener(){
//        @Override
//        public void itemStateChanged(ItemEvent e){
//           String nube=e.getItem().toString();
//            System.out.println(e.getItem());
//
//        }
//        });
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlPrincipal2 = new javax.swing.JPanel();
        pnlInformacionUsuario = new javax.swing.JPanel();
        lbNombre = new javax.swing.JLabel();
        tbNombre = new javax.swing.JTextField();
        lbApellidoPaterno = new javax.swing.JLabel();
        tbApellidoPaterno = new javax.swing.JTextField();
        lbApellidoMaterno = new javax.swing.JLabel();
        tbApellidoMaterno = new javax.swing.JTextField();
        lbDireccion = new javax.swing.JLabel();
        lbPuestoDeTrabajo = new javax.swing.JLabel();
        lbTelefono = new javax.swing.JLabel();
        tbTelefono = new javax.swing.JTextField();
        pnlVehiculo = new javax.swing.JPanel();
        lbTipoVehiculo = new javax.swing.JLabel();
        tbMarcaVehiculo = new javax.swing.JTextField();
        lbMarcaVehiculo = new javax.swing.JLabel();
        lbModeloVehiculo = new javax.swing.JLabel();
        tbModeloVehiculo = new javax.swing.JTextField();
        tbPlacaVehiculo = new javax.swing.JTextField();
        lbPlacaVehiculo = new javax.swing.JLabel();
        cmbTipoVehiculo = new javax.swing.JComboBox();
        btnLimpiar = new javax.swing.JButton();
        btnAgregar = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();
        lbTelefono1 = new javax.swing.JLabel();
        lbTelefono2 = new javax.swing.JLabel();
        tbDni = new javax.swing.JTextField();
        tbMail = new javax.swing.JTextField();
        tbDireccion = new javax.swing.JTextField();
        cmbPuestoTrabajo = new javax.swing.JComboBox();
        lbTelefono3 = new javax.swing.JLabel();
        tbClave = new javax.swing.JTextField();

        setBorder(null);
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Usuario");
        setEnabled(false);

        pnlPrincipal2.setEnabled(false);

        pnlInformacionUsuario.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Agregar", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 1, 13), new java.awt.Color(0, 51, 102))); // NOI18N
        pnlInformacionUsuario.setEnabled(false);

        lbNombre.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbNombre.setForeground(new java.awt.Color(0, 51, 102));
        lbNombre.setText("Nombre");

        tbNombre.setFont(new java.awt.Font("Segoe UI", 0, 12)); // NOI18N
        tbNombre.setForeground(new java.awt.Color(0, 51, 102));

        lbApellidoPaterno.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbApellidoPaterno.setForeground(new java.awt.Color(0, 51, 102));
        lbApellidoPaterno.setText("Apellido Paterno");

        tbApellidoPaterno.setFont(new java.awt.Font("Segoe UI", 0, 12)); // NOI18N
        tbApellidoPaterno.setForeground(new java.awt.Color(0, 51, 102));
        tbApellidoPaterno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tbApellidoPaternoActionPerformed(evt);
            }
        });

        lbApellidoMaterno.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbApellidoMaterno.setForeground(new java.awt.Color(0, 51, 102));
        lbApellidoMaterno.setText("Apellido Materno");

        tbApellidoMaterno.setFont(new java.awt.Font("Segoe UI", 0, 12)); // NOI18N
        tbApellidoMaterno.setForeground(new java.awt.Color(0, 51, 102));
        tbApellidoMaterno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tbApellidoMaternoActionPerformed(evt);
            }
        });

        lbDireccion.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbDireccion.setForeground(new java.awt.Color(0, 51, 102));
        lbDireccion.setText("Dirección");

        lbPuestoDeTrabajo.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbPuestoDeTrabajo.setForeground(new java.awt.Color(0, 51, 102));
        lbPuestoDeTrabajo.setText("Puesto de Trabajo");

        lbTelefono.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbTelefono.setForeground(new java.awt.Color(0, 51, 102));
        lbTelefono.setText("Teléfono");

        tbTelefono.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbTelefono.setForeground(new java.awt.Color(0, 51, 102));

        pnlVehiculo.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Vehículo", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 1, 13), new java.awt.Color(0, 51, 102))); // NOI18N

        lbTipoVehiculo.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbTipoVehiculo.setForeground(new java.awt.Color(0, 51, 102));
        lbTipoVehiculo.setText("Tipo");

        tbMarcaVehiculo.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbMarcaVehiculo.setForeground(new java.awt.Color(0, 51, 102));
        tbMarcaVehiculo.setEnabled(false);

        lbMarcaVehiculo.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbMarcaVehiculo.setForeground(new java.awt.Color(0, 51, 102));
        lbMarcaVehiculo.setText("Marca");

        lbModeloVehiculo.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbModeloVehiculo.setForeground(new java.awt.Color(0, 51, 102));
        lbModeloVehiculo.setText("Modelo");

        tbModeloVehiculo.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbModeloVehiculo.setForeground(new java.awt.Color(0, 51, 102));
        tbModeloVehiculo.setEnabled(false);

        tbPlacaVehiculo.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbPlacaVehiculo.setForeground(new java.awt.Color(0, 51, 102));
        tbPlacaVehiculo.setEnabled(false);

        lbPlacaVehiculo.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbPlacaVehiculo.setForeground(new java.awt.Color(0, 51, 102));
        lbPlacaVehiculo.setText("Placa");

        cmbTipoVehiculo.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        cmbTipoVehiculo.setForeground(new java.awt.Color(0, 51, 102));
        cmbTipoVehiculo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "CARRO", "MOTOCICLETA" }));
        cmbTipoVehiculo.setEnabled(false);

        javax.swing.GroupLayout pnlVehiculoLayout = new javax.swing.GroupLayout(pnlVehiculo);
        pnlVehiculo.setLayout(pnlVehiculoLayout);
        pnlVehiculoLayout.setHorizontalGroup(
            pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlVehiculoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbModeloVehiculo)
                    .addComponent(lbTipoVehiculo))
                .addGap(72, 72, 72)
                .addGroup(pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(cmbTipoVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tbModeloVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(38, 38, 38)
                .addGroup(pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbMarcaVehiculo)
                    .addComponent(lbPlacaVehiculo))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
                .addGroup(pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tbPlacaVehiculo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tbMarcaVehiculo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
        pnlVehiculoLayout.setVerticalGroup(
            pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlVehiculoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlVehiculoLayout.createSequentialGroup()
                        .addComponent(lbTipoVehiculo)
                        .addGap(17, 17, 17))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlVehiculoLayout.createSequentialGroup()
                        .addGroup(pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cmbTipoVehiculo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbMarcaVehiculo)
                            .addComponent(tbMarcaVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGroup(pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlVehiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lbModeloVehiculo)
                        .addComponent(lbPlacaVehiculo)
                        .addComponent(tbPlacaVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(tbModeloVehiculo, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        btnLimpiar.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        btnLimpiar.setForeground(new java.awt.Color(0, 51, 102));
        btnLimpiar.setText("Limpiar");
        btnLimpiar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLimpiarActionPerformed(evt);
            }
        });

        btnAgregar.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        btnAgregar.setForeground(new java.awt.Color(0, 51, 102));
        btnAgregar.setText("Agregar");
        btnAgregar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAgregarActionPerformed(evt);
            }
        });

        btnCancelar.setFont(new java.awt.Font("Segoe UI", 1, 13)); // NOI18N
        btnCancelar.setForeground(new java.awt.Color(0, 51, 102));
        btnCancelar.setText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });

        lbTelefono1.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbTelefono1.setForeground(new java.awt.Color(0, 51, 102));
        lbTelefono1.setText("Mail");

        lbTelefono2.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbTelefono2.setForeground(new java.awt.Color(0, 51, 102));
        lbTelefono2.setText("DNI");

        tbDni.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbDni.setForeground(new java.awt.Color(0, 51, 102));

        tbMail.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbMail.setForeground(new java.awt.Color(0, 51, 102));

        tbDireccion.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        tbDireccion.setForeground(new java.awt.Color(0, 51, 102));

        cmbPuestoTrabajo.setFont(new java.awt.Font("Segoe UI", 0, 12)); // NOI18N
        cmbPuestoTrabajo.setForeground(new java.awt.Color(0, 51, 102));
        cmbPuestoTrabajo.setModel(cmbPuestoModel);
        cmbPuestoTrabajo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cmbPuestoTrabajoItemStateChanged(evt);
            }
        });
        cmbPuestoTrabajo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cmbPuestoTrabajoActionPerformed(evt);
            }
        });

        lbTelefono3.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        lbTelefono3.setForeground(new java.awt.Color(0, 51, 102));
        lbTelefono3.setText("Clave");

        tbClave.setFont(new java.awt.Font("Segoe UI", 0, 12)); // NOI18N
        tbClave.setForeground(new java.awt.Color(0, 51, 102));

        javax.swing.GroupLayout pnlInformacionUsuarioLayout = new javax.swing.GroupLayout(pnlInformacionUsuario);
        pnlInformacionUsuario.setLayout(pnlInformacionUsuarioLayout);
        pnlInformacionUsuarioLayout.setHorizontalGroup(
            pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlInformacionUsuarioLayout.createSequentialGroup()
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlInformacionUsuarioLayout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbApellidoPaterno)
                            .addComponent(lbApellidoMaterno)
                            .addComponent(lbTelefono3)
                            .addComponent(lbNombre))
                        .addGap(23, 23, 23))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacionUsuarioLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(lbPuestoDeTrabajo)
                        .addGap(18, 18, 18)))
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(tbApellidoMaterno)
                    .addComponent(tbApellidoPaterno)
                    .addComponent(tbNombre)
                    .addComponent(cmbPuestoTrabajo, 0, 200, Short.MAX_VALUE)
                    .addComponent(tbClave))
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlInformacionUsuarioLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbTelefono)
                            .addComponent(lbTelefono1))
                        .addGap(23, 23, 23))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacionUsuarioLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbTelefono2)
                            .addComponent(lbDireccion))
                        .addGap(18, 18, 18)))
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tbTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tbDni, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tbMail, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tbDireccion, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
            .addGroup(pnlInformacionUsuarioLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlInformacionUsuarioLayout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(btnAgregar, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnLimpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(164, 164, 164))
                    .addComponent(pnlVehiculo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        pnlInformacionUsuarioLayout.setVerticalGroup(
            pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlInformacionUsuarioLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbTelefono2)
                    .addComponent(tbDni, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbNombre))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbApellidoPaterno, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbDireccion)
                    .addComponent(tbDireccion, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbApellidoPaterno))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(tbApellidoMaterno, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(lbTelefono1)
                        .addComponent(lbApellidoMaterno))
                    .addComponent(tbMail, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnlInformacionUsuarioLayout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tbTelefono, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbTelefono)))
                    .addGroup(pnlInformacionUsuarioLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cmbPuestoTrabajo)
                            .addComponent(lbPuestoDeTrabajo))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tbClave, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
                    .addComponent(lbTelefono3))
                .addGap(30, 30, 30)
                .addComponent(pnlVehiculo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addGroup(pnlInformacionUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnAgregar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLimpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout pnlPrincipal2Layout = new javax.swing.GroupLayout(pnlPrincipal2);
        pnlPrincipal2.setLayout(pnlPrincipal2Layout);
        pnlPrincipal2Layout.setHorizontalGroup(
            pnlPrincipal2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlPrincipal2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlInformacionUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlPrincipal2Layout.setVerticalGroup(
            pnlPrincipal2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlPrincipal2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlInformacionUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pnlPrincipal2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pnlPrincipal2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void tbApellidoPaternoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbApellidoPaternoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tbApellidoPaternoActionPerformed

    private void tbApellidoMaternoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbApellidoMaternoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_tbApellidoMaternoActionPerformed

    private void btnLimpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLimpiarActionPerformed
        // TODO add your handling code here:
        this.tbNombre.setText("");
        this.tbApellidoMaterno.setText("");
        this.tbApellidoPaterno.setText("");
        this.tbDni.setText("");
        this.tbMail.setText("");
        this.tbDireccion.setText("");
        this.tbTelefono.setText("");
        this.tbPlacaVehiculo.setText("");
        this.tbMarcaVehiculo.setText("");
        this.tbModeloVehiculo.setText("");
        this.tbClave.setText("");
        
        
    }//GEN-LAST:event_btnLimpiarActionPerformed

    private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
       this.controlador.cancelar();

    }//GEN-LAST:event_btnCancelarActionPerformed

    private void btnAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarActionPerformed
         this.controlador.agregarNuevoUsuario(this.tbNombre,this.tbApellidoMaterno,this.tbApellidoPaterno,this.tbDni,this.tbMail,this.tbDireccion,this.tbTelefono,this.tbPlacaVehiculo,this.tbMarcaVehiculo,this.tbModeloVehiculo,this.cmbPuestoTrabajo, this.cmbTipoVehiculo, this.tbClave);
    }//GEN-LAST:event_btnAgregarActionPerformed

    private void cmbPuestoTrabajoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbPuestoTrabajoActionPerformed
      
    }//GEN-LAST:event_cmbPuestoTrabajoActionPerformed

    private void cmbPuestoTrabajoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cmbPuestoTrabajoItemStateChanged
             System.out.println(evt.getItem());
             String monita= evt.getItem().toString();
             if (evt.getItem().toString().equals("Conductor")){
                 System.out.println("Es conductor");
                  this.tbPlacaVehiculo.setEnabled(true);
                  this.tbMarcaVehiculo.setEnabled(true);
                  this.tbModeloVehiculo.setEnabled(true);
                  this.cmbTipoVehiculo.setEnabled(true);
                  pnlVehiculo.setVisible(true);
             }
             else{
                  this.tbPlacaVehiculo.setEnabled(false);
                  this.tbMarcaVehiculo.setEnabled(false);
                  this.tbModeloVehiculo.setEnabled(false);
                  this.cmbTipoVehiculo.setEnabled(false);
                  pnlVehiculo.setVisible(false);
             }
          
    }//GEN-LAST:event_cmbPuestoTrabajoItemStateChanged

    /**
     * @param args the command line arguments
     */

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAgregar;
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnLimpiar;
    private javax.swing.JComboBox cmbPuestoTrabajo;
    private javax.swing.JComboBox cmbTipoVehiculo;
    private javax.swing.JLabel lbApellidoMaterno;
    private javax.swing.JLabel lbApellidoPaterno;
    private javax.swing.JLabel lbDireccion;
    private javax.swing.JLabel lbMarcaVehiculo;
    private javax.swing.JLabel lbModeloVehiculo;
    private javax.swing.JLabel lbNombre;
    private javax.swing.JLabel lbPlacaVehiculo;
    private javax.swing.JLabel lbPuestoDeTrabajo;
    private javax.swing.JLabel lbTelefono;
    private javax.swing.JLabel lbTelefono1;
    private javax.swing.JLabel lbTelefono2;
    private javax.swing.JLabel lbTelefono3;
    private javax.swing.JLabel lbTipoVehiculo;
    private javax.swing.JPanel pnlInformacionUsuario;
    private javax.swing.JPanel pnlPrincipal2;
    private javax.swing.JPanel pnlVehiculo;
    private javax.swing.JTextField tbApellidoMaterno;
    private javax.swing.JTextField tbApellidoPaterno;
    private javax.swing.JTextField tbClave;
    private javax.swing.JTextField tbDireccion;
    private javax.swing.JTextField tbDni;
    private javax.swing.JTextField tbMail;
    private javax.swing.JTextField tbMarcaVehiculo;
    private javax.swing.JTextField tbModeloVehiculo;
    private javax.swing.JTextField tbNombre;
    private javax.swing.JTextField tbPlacaVehiculo;
    private javax.swing.JTextField tbTelefono;
    // End of variables declaration//GEN-END:variables
}
